<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function test() {
            console.log(123)
            console.log(456)
            console.log(789)
        }
    </script>
</head>
<body>

    <!-- 当按钮被点击的时候，就会执行onclick的属性值 -->
    <button onclick="test()">测试</button>

</body>
</html>